v0.7.1#19
Conversation
Add authentication types to the decoder. Also the process messages has been moved to a seperate file process.go.
Add new table schemas for the database. Also added the missing spend period in the indexer/decoder/process.go
Add methods to convert from decoded, to database types. Moved the functions to converter.go file.
Add insert methods and have added missing AllowPath on the create session message type.
The data processor had to handle a bit of data transfer from one type to another. Adding 4 new types makes adding even more new data types harder as the chain grows. So some of the functionality will fall upon the decoder.
Fixed the session key since it expected to find a session_key_raw. The session key is identical to regular address so it will be inserted as a regular address. Add missing Allow Paths to the auth create session schema.
Add handlers and sql queries for the new message types.
|
Warning Review limit reached
More reviews will be available in 18 minutes and 31 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (8)
📝 WalkthroughWalkthroughAdds support for ChangesAuth Session & Multi-Send Message Support
Sequence Diagram(s)sequenceDiagram
participant TX as Raw Transaction
participant process.go as process.go
participant convert.go as convert.go
participant product.go as DbMessageGroups
participant operator.go as DataProcessor
participant insert.go as TimescaleDB Insert
participant query_msg.go as TimescaleDB Query
participant transactions.go as API Handler
TX->>process.go: processMsgs(tx, messages) — dispatch by concrete type
process.go-->>product.go: messages[i] map[string]any (bank/vm/auth)
product.go->>convert.go: cvt.toMsgAuthCrSession / toMsgMultiSend / ...
convert.go-->>product.go: dataTypes.MsgAuth* / MsgMultiSend structs
product.go->>product.go: Merge() into aggregatedDbGroups
product.go->>operator.go: AllAddressEntries() for address tx building
operator.go->>insert.go: InsertMsgAuthCrSession / InsertMsgAuthRvSession / InsertMsgAuthRvAllSessions
query_msg.go->>transactions.go: GetBankMultiSend / GetMsgAuthCrSession / GetMsgAuthRvSession / GetMsgAuthRvAllSessions
transactions.go-->>transactions.go: getBankMultiSendResponse / getMsgAuthCrSessionResponse
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 8
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@api/handlers/transactions.go`:
- Around line 489-507: The auth create-session response mapping is dropping the
AllowPaths field returned by GetMsgAuthCrSession, so clients never receive that
indexed data. Update the TransactionMessage shape in humatypes and the mapper in
transactions.go so the loop that builds response[index] copies d.AllowPaths
through alongside the other session fields. Keep the API response model and this
conversion logic in sync, using GetMsgAuthCrSession and TransactionMessage as
the key symbols to update.
In `@api/huma-types/transaction.go`:
- Around line 57-61: The public create-session contract is missing the
allow_paths permission field, so add it to TransactionMessage alongside the
existing auth message fields. Update the TransactionMessage struct in
huma-types/transaction.go to include an allow_paths field with the same shape
used by auth_msg_create_session persistence/querying, and ensure its JSON/doc
tags match the API contract so the session response can return this data.
In `@cliff.toml`:
- Line 5: The preview command in the cliff configuration uses an incorrect tag
format with an extra dot, so update the tag value in the preview command to
match the intended pattern. Fix the tag string in the commented git cliff
example so it uses the correct `v0.7.1` form, preserving the existing preview
command structure and related configuration around the cliff.toml preview
setting.
In `@indexer/cli/setup.go`:
- Around line 252-257: Remove the duplicate sdt.MsgMultiSend registration in the
hypertable setup list so CreateHypertableFromStruct is only invoked once for
bank_msg_multi_send. Keep the existing entry in the setup slice and delete the
newly added one in the same block near the dbinit.HypertableParams definitions,
since the duplicate TableName() causes redundant setup and can fail if the call
is not idempotent.
In `@indexer/decoder/convert.go`:
- Around line 255-266: The MsgAddPackage builder is dropping the pkg_file_names
data during conversion, which causes add-package rows to lose their file list.
Update the converter logic in the MsgAddPackage construction path (and the
matching run-package builder referenced by the same refactor) to pass through
the decoded pkg_file_names field into the dataTypes.MsgAddPackage struct so the
DB column stays populated. Keep the change aligned with the existing decoder
fields and the struct’s PkgFileNames member.
In `@indexer/decoder/process.go`:
- Around line 232-238: Normalize the revoke-session message shape in process.go
so it matches the other auth path. In the code that builds the auth message map
for auth_msg_revoke_session, use the same string form for the session key as the
existing session/message helpers expect, instead of storing session_key_raw as
bytes. Update the map keys and any downstream use in toMsgRvSession() so
pre-resolution and parsing consume session_key consistently.
In `@indexer/decoder/product.go`:
- Around line 27-29: The per-message decode failure in NewDecodedMsg should not
call Fatal() and terminate the worker. Change the error handling in product.go
so the decode error is returned to the caller instead of exiting the process,
and let the message-processing loop or batch-level handler decide how to log or
skip the bad transaction. Keep the fix focused on the NewDecodedMsg path and its
caller so a single malformed tx cannot take down the entire indexer.
In `@pkgs/sql_data_types/hypertables.go`:
- Around line 581-585: The auth-session address helpers are omitting
signer-to-tx links because `GetAllAddresses()` only adds creator/session key
addresses, while `AllAddressEntries()` relies on it to build `address_tx`.
Update the `GetAllAddresses()` implementations for the auth-session message
types (including `MsgAuthCrSession` and the other affected methods in the diff)
to also add the persisted `Signers` entries to the returned `TxAddresses`, so
signer relations are included alongside the existing addresses.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: d52076b7-b449-45a2-a25f-42c24136d5d9
⛔ Files ignored due to path filters (1)
go.sumis excluded by!**/*.sum
📒 Files selected for processing (20)
CHANGELOG.mdapi/handlers/database_test.goapi/handlers/interface.goapi/handlers/transactions.goapi/huma-types/transaction.gocliff.tomlgo.modindexer/cli/setup.goindexer/data_processor/operator.goindexer/data_processor/operator_test.goindexer/data_processor/types.goindexer/decoder/convert.goindexer/decoder/decoder.goindexer/decoder/process.goindexer/decoder/product.gopkgs/database/timescaledb/insert.gopkgs/database/timescaledb/query_block.gopkgs/database/timescaledb/query_msg.gopkgs/database/types.gopkgs/sql_data_types/hypertables.go
💤 Files with no reviewable changes (1)
- indexer/decoder/decoder.go
| // It should never happen, but we need some way to halt the program. | ||
| l.Fatal().Stack().Msgf("failed to decode message %s", err) | ||
| return nil |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟠 Major | 🏗️ Heavy lift
Don't terminate the whole indexer on one decode failure.
Line 28 turns a per-transaction decode error into a process exit. Since NewDecodedMsg() is called from the message-processing loop, one malformed or newly unsupported tx can now take down the whole worker instead of being reported upstream and handled at batch scope.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@indexer/decoder/product.go` around lines 27 - 29, The per-message decode
failure in NewDecodedMsg should not call Fatal() and terminate the worker.
Change the error handling in product.go so the decode error is returned to the
caller instead of exiting the process, and let the message-processing loop or
batch-level handler decide how to log or skip the bad transaction. Keep the fix
focused on the NewDecodedMsg path and its caller so a single malformed tx cannot
take down the entire indexer.
For some reason new version of govulncheck has a problem with v1.26.*.
|


Summary by CodeRabbit
New Features
Bug Fixes
Chores